//
//  HomeXianhuoCell.swift
//  YunshuApp
//
//  Created by 周文杰 on 2017/5/6.
//  Copyright © 2017年 zwj. All rights reserved.
//

import UIKit

class HomeXianhuoCell: UITableViewCell {

    @IBOutlet weak var iconView: UIImageView!
    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var dateLabel: UILabel!
    @IBOutlet weak var companyLabel: UILabel!
    @IBOutlet weak var locationLabel: UILabel!
    
    @IBOutlet weak var categoryLabel: UILabel!
    @IBOutlet weak var line: UIView!
    
    var index = -1
    var onTapImage: (Int)->Void = {index -> Void in }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        iconView.contentMode = .scaleAspectFill
        iconView.clipsToBounds = true
        let tapGes = UITapGestureRecognizer.init(target: self, action: #selector(HomeXianhuoCell.onTap))
        iconView.isUserInteractionEnabled = true
        iconView.addGestureRecognizer(tapGes)
    }
    
    @objc func onTap(){
        self.onTapImage(self.index)
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
